home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 113 / gfatip08 / gfatip08.doc < prev    next >
Text File  |  1987-09-25  |  4KB  |  98 lines

  1.  
  2.  
  3.                                                 September 7, 1987
  4.  
  5.  
  6.                            GFATIP08.DOC
  7.  
  8.                         by John B. Holder
  9.                      Senior Software Engineer
  10.                      Marathon Computer Press
  11.            Asst. Sysop on GEnie's MichTron Roundtable
  12.  
  13.  
  14.      This is the 8th in a planned series of GFA Tip files. This is 
  15. the latest in the series designed to assist the GFA Basic 
  16. programmer in getting the most out of his computing dollar.  The 
  17. topic of this issue is timing of software execution speeds. In 
  18. this archive you will find the following files:
  19.  
  20.      Timer.Prg    => Actual timing program
  21.      Command.Tos  => PD CLI program {From GEMBOOT2}
  22.      Timetest.Prg => GFA Basic Compiled Program
  23.      Timetest.Bas => GFA Basic Source Code for the timetest program
  24.      Dialtest.Prg => Compiled GFA Companion Dialog Box
  25.      GFATIP08.DOC => This file
  26.  
  27.      In past GFA Basic Conferences the question has arisen many 
  28. times, "How do I time the total execution speed of a program or 
  29. software procedure?".  This set of utilities is designed to help 
  30. you do just that.  You can time a critical routine within a 
  31. project you are working on to get an idea of execution times, and 
  32. with a bit of practice you can learn to optimize your code to make 
  33. it run faster.  The soon to be released "GFA Book" will help you 
  34. even more in this endeavor.  It will be available from MichTron in 
  35. a month or so.
  36.  
  37.      Command.Tos:
  38.  
  39.      To run the CLI just double click from the desktop.  When the 
  40. prompt appears, you may enter ? to see a listing of supported 
  41. commands within the CLI.  It's sole purpose is to allow you to 
  42. execute the Timer.Prg and pass a command line to it.  To execute 
  43. the sample GFA Basic program included enter the following at the 
  44. CLI prompt:
  45.  
  46.                         timer timetest.prg
  47.  
  48.                                 or
  49.  
  50.                         timer dialtest.prg
  51.  
  52.      Timer.Prg:
  53.  
  54.      This program was written in C and is designed to time 
  55. sections of compiled code for you.  You must remember the 
  56. following to be successful with the timer.
  57.  
  58.      1) Always enter the extension of the program you wish to 
  59. time, eg..  timetest.(prg)(tos)(ttp)
  60.  
  61.      2) Since it is futile to time a program that uses GEM 
  62. interaction, that has been disallowed.  It is useless to time a 
  63. piece of code you wish to optimize if there are GEM menus or Alert 
  64. Boxes in it.  The overall idea here is to produce fast code that 
  65. can be accurately timed.  If you happen to accidentally include a 
  66. section of code that has an alert box in it, you may exit if you 
  67. have included a hot button to abort with the return key.  So keep 
  68. it in mind that if you have Alert boxes, menus, or Non-GFA 
  69. Companion Dialog boxes {You may test sections of code that utilize 
  70. GFA Companion generated Dialog Boxes} that utilize the GEM AES, 
  71. you will have to reboot your system.  The use of the mouse is not 
  72. affected in most cases if the code section uses a Showm at the top 
  73. of the procedure that requires it.  Only the mouse interaction 
  74. with the AES is affected.
  75.      By including the above exclusion, I am not attempting to 
  76. shoot down GEM at all (I happen to like GEM).  This utility is 
  77. for testing sections of code that utilize a lot of math, I/O, or 
  78. printing routines.  Use the timetest.bas program for an example.  
  79. By using Timer.Prg with sections of code that have been compiled, 
  80. you may be able to experiment and speed up critical sections of 
  81. your program.  You can experiment with Loops, For Next, Inc, Add, 
  82. or whatever you believe will help to speed up execution times & 
  83. Timer.prg will help you to keep a track record of performance.  
  84. These crucial sections of code can then be included in a Fully GEM 
  85. based program at a later time.
  86.      I hope that this helps you to optimize your code, and create 
  87. faster running GFA Basic programs.
  88.  
  89.                          John B. Holder
  90.  
  91. Notice:
  92.  
  93.      Feel free to u/l this ARC'hive anywhere you like, however 
  94. please do so in it's entirety.  Timer.Prg is (c)1987 Marathon 
  95. Computer Press and may not be sold without prior approval of owner 
  96. of copyright.
  97.  
  98.